package com.sinoglobal.dumping.util;

import android.app.Activity;
import android.content.Context;

import com.sinoglobal.dumping.bean.Dumpling_LogOutAcquireDumplingBean;
import com.sinoglobal.dumping.dumplingdialog.DumplingDialogHelper;

import static com.sinoglobal.dumping.base.Dumpling_SinoConstans.DUMPLING_CODE;
import static com.sinoglobal.dumping.base.Dumpling_SinoConstans.DUMPLING_COUNT;
import static com.sinoglobal.dumping.base.Dumpling_SinoConstans.DUMPLING_COUPON;
import static com.sinoglobal.dumping.base.Dumpling_SinoConstans.DUMPLING_ID_LIST;
import static com.sinoglobal.dumping.base.Dumpling_SinoConstans.DUMPLING_MARK_LOGIN;
import static com.sinoglobal.dumping.base.Dumpling_SinoConstans.DUMPLING_MARK_SHARE;
import static com.sinoglobal.dumping.base.Dumpling_SinoConstans.DUMPLING_MONEY;
import static com.sinoglobal.dumping.base.Dumpling_SinoConstans.DUMPLING_TYPE;
import static com.sinoglobal.dumping.base.Dumpling_SinoConstans.LOGIN_STATE_LOGOUT;
import static com.sinoglobal.dumping.base.Dumpling_SinoValueManager.getValue;

/**
 * Created by KeZhuang on 2016/1/14.
 */
public class DumplingUtils {
    public static double getMoney(Context context){return (Double) getValue(context,DUMPLING_MONEY,0.0);}
    public static int getCoupon(Context context){return (Integer) getValue(context,DUMPLING_COUPON,0);}
    public static int getCount(Context context){return (Integer) getValue(context, DUMPLING_COUNT, 0);}
    public static int getShare(Context context){return (Integer) getValue(context, DUMPLING_MARK_SHARE, 0);}
    public static int getLogin(Context context){return (Integer) getValue(context, DUMPLING_MARK_LOGIN, LOGIN_STATE_LOGOUT);}
    public static int getType(Context context){return (Integer) getValue(context,DUMPLING_TYPE,0);}
    public static int getCode(Context context){return (Integer)getValue(context,DUMPLING_CODE,0);}
    public static String getDumplingIds(Context context){return (String)getValue(context,DUMPLING_ID_LIST,"");}
    public static void showDialog(Context context,Dumpling_LogOutAcquireDumplingBean acquireDumplingBean){
        DumplingDialogHelper.getDialog((Activity) context,acquireDumplingBean).show();}
}
